# a=3.1415926
#
# print("{:6.2f}".format(3.13))
# name=1234
# stu_job="zhangze-字节跳动"
# print(f"我的名字是{name},我的工作是{stu_job}")
# print(f"我的名字是{"zhangze"},我的工作是{"zijie"}")
# print("我的名字是%d,我的工作是%s"%(name,stu_job))
# bool类型
# a=1234
# b=2345
# r=a>=b
# print (r,type(r))
# print(f"a==b的结果为{a==b}",a==b)
# if a>b:
#     print("错了")
# else:
#     print("duile")


# age=int (input("请输入你的年龄："))
# if age<30:
#     print("不用补票")
# else:
#     print("你已成年，需要补票")
# import random
# r=random.randint(1,10)
# guess=int(input("输入一个整数："))
# if guess>r:
#     print("猜大了")
#     guess = int(input("输入一个整数："))
#     if guess>r:
#         print("猜大了")
#         guess = int(input("输入一个整数："))
#         if guess > r:
#             print("猜大了")
#         elif guess < r:
#             print("猜小了")
#         else:
#             print("猜对了")
#     elif guess<r:
#         print("猜小了")
#         guess = int(input("输入一个整数："))
#         if guess > r:
#             print("猜大了")
#         elif guess < r:
#             print("猜小了")
#         else:
#             print("猜对了")
#     else:
#         print("猜对了")
# elif guess < r:
#     print("猜小了")
#     guess = int(input("输入一个整数："))
#     if guess>r:
#         print("猜大了")
#         if int(input("输入一个整数：")) > r:
#             print("猜大了")
#         elif int(input("输入一个整数：")) < r:
#             print("猜小了")
#         else:
#             print("猜对了")
#     elif guess<r:
#         print("猜小了")
#         if int(input("输入一个整数：")) > r:
#             print("猜大了")
#         elif int(input("输入一个整数：")) < r:
#             print("猜小了")
#         else:
#             print("猜对了")
#     else:
#         print("猜对了")
# else:
#     print("猜对了")

# import random
# r=random.randint(1,10)
# count=5
# while count>=0:
#     guess=int (input("请输入你要猜的数字："))
#     if guess>r:
#         print("猜大了，你还有%d次机会"%count)
#     elif guess<r:
#         print("猜小了，你还有%d次机会"%count)
#     else:
#         print("恭喜你，猜对了")
#         break
#     count-=1
# if count<0:
#     print("game over")
# r=int (input())
# a=1
# while a<=r:
#     b=1
#     while b<=a:
#         print(f"{b}*{a}={a*b}  \t ",end='')
#         b+=1
#     print()
#     a+=1
# names="gdgagdgagdga"
# count=0
# for x in names:
#     if x == "a":
#         count+=1
# print(count)
# num=int(input())
# count=0
# for x in range(1,num):
#     if x%2==0:
#         count+=1
# print(f"1~{num}中共有{count}个偶数")
#
#
# i=1
# for i in range(1,101):
#     print("今天是表白小美的第%d天" %i)
#     for j in range(1,11):
#         print(f"送给小美的第{j}束玫瑰花")
#     print("小美，我喜欢你",end='')
#     print("第%d天的表白结束"%i)
# i=int (input())
# for a in range(1,i+1):
#     for b in range(1,a+1):
#         print(f"{b}*{a}={a*b} \t",end='')
#
#     print()


# import random
# money=10000
# for a in range(1,21):
#     r=random.randint(1,10)
#     if money>0:
#         if r>=5:
#             print(f"向员工{a}发放工资1000元，账户余额还剩{money-1000}")
#         else:
#             print(f"员工{a}，绩效分{r},低于5，不发工资，下一位")
#     else:
#         print(f"工资发完了，下个月领取吧。")
#     money-=1000

def menu():
    print("------------------主菜单------------------")
    print(f"{name}，您好，欢迎来到黑马银行ATM，请选择操作： ")
    print("查询余额 [请输入1]--------------------------")
    print("存款    [请输入2]--------------------------")
    print("取款    [请输入3]--------------------------")
    print("退出    [请输入4]--------------------------")

def yu_e():
    print("----------余额------------")
    global money
    print(f"{name}，您好，您的余额为{money}")

def cun_money():
    print("----------存款------------")
    global money
    money1=int(input("请输入你要存款的金额："))
    money = money + money1
    print(f"{name},您好,您存款{money1}成功")
    yu_e()

def qu_kuan():
    print("-----------取款------------")
    global money
    money2=int(input("请输入您要取款的金额："))
    money = money - money2
    print(f"{name},您好,您取款{money2}成功")
    yu_e()

name =input("请入您的名字：")
money=5000000
money1=0
money2=0
menu()
while True :
    choice = int(input("请输入您的选择："))
    if choice==1:
        yu_e()
        continue
    elif choice==2:
        cun_money()
        continue
    elif choice==3:
        qu_kuan()
        continue
    elif choice==4:
        break
    else:
        print("输入错误")
        continue































